package plantshop.controller.moves;

import java.io.Serializable;

import plantshop.model.CollisionDetector;
import plantshop.model.Customer;
import plantshop.model.Game;
import plantshop.model.Location;

public class CustomerWalkMove extends TimeMove implements Serializable{
	private static final long serialVersionUID = -4252269435511904298L;
	private Customer c;
	private int x, y;
	
	public CustomerWalkMove(Customer c, int x, int y){
		this.c = c;
		this.x = x;
		this.y = y;
	}

	@Override
	public void execute(Game game) {
		if(CollisionDetector.isValid(new Location(c.getLoc().getX()+x, c.getLoc().getY()+y), c)==1)
			c.setLoc(new Location(c.getLoc().getX()+x,c.getLoc().getY()+y));
	}
	
	public int getX()
	{
		return x;
	}
	
	public int getY()
	{
		return y;
	}
}
